package team;

public class TeamMember {
    private final String name;
    private final int age;
    private final double[] scores; // 存放5个项目的成绩

    public TeamMember(String name, int age, double[] scores) {
        this.name = name;
        this.age = age;
        this.scores = scores;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public double[] getScores() {
        return scores;
    }

    public double getAverageScore() {
        double sum = 0;
        for (double score : scores) {
            sum += score;
        }
        return sum / scores.length;
    }
}
